cmake_minimum_required(VERSION 3.5.0)
project(SM2 VERSION 0.1.0 LANGUAGES C)

set(TARGET_APP "SM2")



# 设置可以调试的模式
# SET(CMAKE_BUILD_TYPE "Debug")
# SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")


# 添加头文件
set(APP_INCLUDES
    ${APP_INCLUDES}
)

set(APP_LIBRARIES
    ${APP_LDFLAGS}
    # 链接 GMP 库
    gmp
    # 链接 Math 库
    m
)



# 添加源文件
set(APP_SOURCES
    ${APP_SOURCES}
    main.c
    kdf.c
    pointoperation.c
    sm2.c
    sm3.c
)


add_executable(${TARGET_APP} ${APP_SOURCES})
target_include_directories(${TARGET_APP} PUBLIC ${APP_INCLUDES})
target_link_libraries(${TARGET_APP} ${APP_LIBRARIES})